<?xml version="1.0" encoding="UTF-8"?>

<!--
    converts ugly xml to nice xml for further actions
-->

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output encoding="UTF-8"/>
<xsl:template match="/">
    <events xsi:noNamespaceSchemaLocation="NiceXmlSchema.xsd" xmlns="" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
        <xsl:for-each select="DInfo/XML/DOC">
            <event              
                id="{@id}" 
                bx="{MJD/MSG/MLOC/SNTL/SBEG/@x}"
                by="{MJD/MSG/MLOC/SNTL/SBEG/@y}"
                ex="{MJD/MSG/MLOC/SNTL/SEND/@x}"
                ey="{MJD/MSG/MLOC/SNTL/SEND/@y}"
                stadatetime="{MJD/MSG/MTIME/TSTA/@date} {MJD/MSG/MTIME/TSTA/@time}"
                stodatetime="{MJD/MSG/MTIME/TSTO/@date} {MJD/MSG/MTIME/TSTO/@time}"
                desclong="{MJD/MSG/MTXT}"
                descshort="{MJD/MSG/MEVT/OTXT}"
                position="{MJD/MSG/MLOC/TXPL}"
                type="{MJD/MSG/MEVT/TMCE/EVI/@eventcode}"               
                />            
                     
           
        </xsl:for-each>
    </events>
</xsl:template>
</xsl:stylesheet>
